﻿CREATE TABLE [dbo].[UserDetails] (
    [IdUser]             INT          NOT NULL,
    [ReferralId]         VARCHAR (6)  NOT NULL,
    [ParentReferralId]   VARCHAR (6)  NOT NULL,
    [FirstName]          VARCHAR (50) NOT NULL,
    [LastName]           VARCHAR (50) NOT NULL,
    [SignUpIPAddress]    VARCHAR (15) NULL,
    [LastLogInIPAddress] VARCHAR (15) NULL,
    [LastLoginDate]      DATETIME     NOT NULL,
    CONSTRAINT [PK_UserDetails] PRIMARY KEY CLUSTERED ([IdUser] ASC),
    CONSTRAINT [FK_UserDetails_Users] FOREIGN KEY ([IdUser]) REFERENCES [dbo].[Users] ([Id])
);

